package pub.cleangao.codegen.sqlexe;


/**
 * SQL 语法方言
 *
 * <p>对应数据库类型</p>
 */
public enum Dialect {
    SqlServer,
    MySQL,
    Mariadb,
    Oracle,
    Postgres,
    SQLite;

    public static String fromDbType(DbType dbType) {
        for (Dialect dialect : Dialect.values()) {
            if (dbType.getSignature().contains(dialect.name().toLowerCase())) {
                return dialect.name();
            }
        }
        return null;
    }
}
